package user_api

import (
	"github.com/gogf/gf/frame/g"
)

// 系统用户模块
const (
	OPEN_API_SYSTEM_NAME_LIST   = "user.system.list"
	OPEN_API_SYSTEM_NAME_CREATE = "user.system.create"
	OPEN_API_SYSTEM_NAME_UPDATE = "user.system.update"
	OPEN_API_SYSTEM_NAME_DELETE = "user.system.delete"
)

// 获取系统用户列表
func GetSystemUserList(params map[string]interface{}) string {
	return CallApi(OPEN_API_SYSTEM_NAME_LIST, params)
}

// 创建系统用户
func CreateSystemUser(params map[string]interface{}) string {
	return CallApi(OPEN_API_SYSTEM_NAME_CREATE, g.Map{
		"name": params["name"],
		"code": params["code"],
	})
}

// 编辑系统用户
func UpdateSystemUser(id string, params map[string]interface{}) string {
	return CallApi(OPEN_API_SYSTEM_NAME_UPDATE, g.Map{
		"api_uri_placeholder_values": g.Map{
			"id": id,
		},
		"name": params["name"],
		"code": params["code"],
	})
}

// 删除系统用户
func DeleteSystemUser(id string) string {
	return CallApi(OPEN_API_SYSTEM_NAME_DELETE, g.Map{
		"api_uri_placeholder_values": g.Map{
			"id": id,
		},
	})
}
